<div class="modal-header"><button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button></div>
<div class="modal-body form-horizontal tab-content">
<ul class="nav nav-tabs" style="margin-top:-28px">
	<li ng-repeat="tab in modaldata.tabs" ng-class="{'active':modaldata.op==tab.op}"><a href="javascript:;" ng-click="getmodal(modal,tab.op)">{{tab.title}}</a></li>
</ul>
<div ng-show="modaldata.op=='local'" style="margin-top:15px">
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 left-label">选择上传</label>
		<div class="col-sm-8">
			<div class="input-group">
				<input type="text" class="form-control " placeholder=""  ng-model="modaldata.image" readonly="readonly" />
				<span class="input-group-btn">
					<button class="btn btn-primary" type="button" ng-click="up_file(modaldata,'image','image')"><i class="fa fa-external-link"></i> 选择上传</button>
				</span>
				
			</div>
			<span class="help-block" ></span>
		</div>
	</div>
</div>

<div ng-show="modaldata.op=='remote'"  style="margin-top:15px">
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 left-label">填写远程地址</label>
		<div class="col-xs-12 col-sm-8 col-lg-9">
			<input type="text" class="form-control " ng-model="modaldata.url" />
			<div class="help-block">输入图片地址</div>
		</div>
	</div>
</div>
<div ng-show="modaldata.op=='list'" style="margin-top:15px">
<div class="keyword-list-head">
	<div class="keyword-list-head clearfix">
		<div class="input-group jinyun-margin-bottom" style="width:465px;">
			<input class="form-control" type="text" ng-model="modaldata.params.title" value="" placeholder="输入图片名称" style="width: 427px;">
			<span class="input-group-btn"><button id="submit" ng-click="modaldata.params.page=1;getmodal(modal,modaldata.op,made_query(modaldata.params))" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button></span>
		</div>
	</div>
</div>
<div class="clearfix">
<div class="form-group">
	<div class="btn-group site-tp-group">
		<a href="" ng-repeat="group in modaldata.groups" ng-class="{'btn': 1,'active': modaldata.params.group_id == group.id}" ng-click="modaldata.params.page=1;modaldata.params.group_id=group.id;getmodal(modal,modaldata.op,made_query(modaldata.params))">{{group.title}}</a>
	</div>
</div>
<div class="upimage">
  <div class="inner_container_box side_r cell_layout">
    <div class="inner_main">
      <div class="bd">
        <div class="media_list">
			<div style="padding-right:20px;" ng-include="sys_html('common/modal_page',true)"></div>
			<div class="group img_pick" id="js_imglist">
            <ul class="group">
              <li class="img_item js_imgitem" ng-repeat="item in modaldata.list">
                <div class="img_item_bd" ng-click="modaldata.choose_image(item.attachment)">
                  <span class="js_img_icon pic cover" style="background-image:url({{tomedia(item.attachment) || '../core/resource/images/nopic.jpg'}})"></span>
                  <span class="check_content t-c">
                    <label class="frm_checkbox_label">
						<input type="checkbox" style="margin-top:-24px;" ng-checked="modaldata.images.indexOf(';'+item.attachment+';')>=0">
						<span class="lbl_content">{{item.title}}</span>
					</label>
                  </span>
                </div>
                
              </li>
         
            </ul>
          </div>
		</div>
      </div>
    </div>
</div>
</div>
</div>
</div>
<script>
window.scope.modaldata.remote_up=function(url){
	var data={'url':url,'type':'image'};
	var post={'data':data,'plugin':'core','action':'tools.file_upload','op':'remote'};
	post.callback=function(res){
		window.scope.modal_result(res);
		window.scope.$apply();
	}
	window.scope.post_json(post);
}
window.scope.modaldata.choose_image=function(image){
	if(window.scope.modaldata.type=='more'){
		window.scope.duoxuans(image,window.scope.modaldata,'images');
		//console.log(window.scope.modaldata.images);
	}else{
		window.scope.modal_result(image);
	}
	
}
</script>
</div>
<div class="modal-footer" ng-if="modaldata.op=='local'"><a href="#" class="btn btn-primary" ng-click="modal_result(modaldata.image)">确定</a></div>
<div class="modal-footer" ng-if="modaldata.op=='remote'"><a href="#" class="btn btn-primary" ng-click="modaldata.remote_up(modaldata.url)">确定</a></div>
<div class="modal-footer" ng-if="modaldata.op=='list' && modaldata.type=='more'"><a href="#" class="btn btn-primary" ng-click="modal_result(modaldata.images)">确定</a></div>
